home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-13 | 28.1 KB | 606 lines | [TEXT/CCL2] |
-
- (in-package :TRAPS) ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OPEN SCRIPTING ARCHITECTURE: Client Interface
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // Copyright © 1992 Apple Computer, Inc. All rights reserved.
- ; // Authors: Jens Alfke, William Cook, Donn Denman, and Warren Harris
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // This interface defines what it means to be a "scripting component."
- ; // Scripting components allow "scripts" to be loaded and executed. This
- ; // interface does not define the way in which a particular scripting
- ; // component's scripts are editing and debugged.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
- ; $IFC UNDEFINED UsingIncludes
- ; $SETC UsingIncludes := 0
- ; $ENDC
-
- ; $IFC NOT UsingIncludes
-
- ; $ENDC
-
- ; $IFC UNDEFINED UsingOSA
- ; $SETC UsingOSA := 1
-
- ; $I+
- ; $SETC OSAIncludes := UsingIncludes
- ; $SETC UsingIncludes := 1
- ; $IFC UNDEFINED UsingAppleEvents
-
- (require-interface 'APPLEEVENTS); $I $$Shell(PInterfaces)AppleEvents.p
- ; $ENDC
- ; $IFC UNDEFINED UsingAEObjects
-
- (require-interface 'AEOBJECTS) ; $I $$Shell(PInterfaces)AEObjects.p
- ; $ENDC
- ; $IFC UNDEFINED UsingComponents
-
- (require-interface 'COMPONENTS) ; $I $$Shell(PInterfaces)Components.p
- ; $ENDC
- ; $SETC UsingIncludes := OSAIncludes
-
- ; Types and Constants
-
- (defconstant $kOSAComponentType :|osa |)
- (defconstant $kOSAGenericScriptingComponentSubtype :|scpt|)
-
- (defconstant $kOSAFileType :|osas|)
- ; Type of script document files.
-
- (def-mactype :OSAID (find-mactype :SIGNED-LONG))
- (def-mactype :OSAERROR (find-mactype :SIGNED-LONG))
-
- (defconstant $kOSANullScript 0)
- (defconstant $kOSANullMode 0)
- (defconstant $kOSAModeNull 0)
-
- (defconstant $kOSASuite :|ascr|)
- (defconstant $kOSARecordedText :|recd|)
-
- (defconstant $kOSAScriptResourceType #$KOSAGENERICSCRIPTINGCOMPONENTSUBTYPE)
- (defconstant $typeOSAGenericStorage #$KOSASCRIPTRESOURCETYPE)
-
- ; Error Codes
-
- ; API Errors
- (defconstant $errOSASystemError -1750)
- (defconstant $errOSAInvalidID -1751)
- (defconstant $errOSABadStorageType -1752)
- (defconstant $errOSAScriptError -1753)
- (defconstant $errOSABadSelector -1754)
- (defconstant $errOSASourceNotAvailable -1756)
- (defconstant $errOSANoSuchDialect -1757)
- (defconstant $errOSADataFormatObsolete -1758)
- (defconstant $errOSADataFormatTooNew -1759)
- (defconstant $errOSACorruptData #$ERRAECORRUPTDATA)
- (defconstant $errOSARecordingIsAlreadyOn #$ERRAERECORDINGISALREADYON)
-
- ; Dynamic errors
- (defconstant $errOSACantCoerce #$ERRAECOERCIONFAIL)
- (defconstant $errOSACantAccess #$ERRAENOSUCHOBJECT)
- (defconstant $errOSACantAssign -10006)
- (defconstant $errOSAGeneralError -2700)
- (defconstant $errOSADivideByZero -2701)
- (defconstant $errOSANumericOverflow -2702)
- (defconstant $errOSACantLaunch -2703)
- (defconstant $errOSAAppNotHighLevelEventAware -2704)
- (defconstant $errOSACorruptTerminology -2705)
- (defconstant $errOSAStackOverflow -2706)
- (defconstant $errOSAInternalTableOverflow -2707)
- (defconstant $errOSADataBlockTooLarge -2708)
-
- ; Component-specific dynamic script errors: -2720 thru -2739
-
- ; Static errors
- (defconstant $errOSATypeError #$ERRAEWRONGDATATYPE)
- (defconstant $errOSAMessageNotUnderstood #$ERRAEEVENTNOTHANDLED)
- (defconstant $errOSAUndefinedHandler #$ERRAEHANDLERNOTFOUND)
- (defconstant $errOSAIllegalAccess #$ERRAEACCESSORNOTFOUND)
- (defconstant $errOSAIllegalIndex #$ERRAEILLEGALINDEX)
- (defconstant $errOSAIllegalRange #$ERRAEIMPOSSIBLERANGE)
- (defconstant $errOSAIllegalAssign -10003)
- (defconstant $errOSASyntaxError -2740)
- (defconstant $errOSASyntaxTypeError -2741)
- (defconstant $errOSATokenTooLong -2742)
- (defconstant $errOSAMissingParameter #$ERRAEDESCNOTFOUND)
- (defconstant $errOSAParameterMismatch #$ERRAEWRONGNUMBERARGS)
- (defconstant $errOSADuplicateParameter -2750)
- (defconstant $errOSADuplicateProperty -2751)
- (defconstant $errOSADuplicateHandler -2752)
- (defconstant $errOSAUndefinedVariable -2753)
- (defconstant $errOSAInconsistentDeclarations -2754)
- (defconstant $errOSAControlFlowError -2755)
-
- ; Component-specific static script errors: -2760 thru -2779
-
- ; Dialect-specific script errors: -2780 thru -2799
-
- ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OSA Interface Descriptions
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // The OSA Interface is broken down into a required interface, and several
- ; // optional interfaces to support additional functionality. A given scripting
- ; // component may choose to support only some of the optional interfaces in
- ; // addition to the basic interface. The OSA Component Flags may be used to
- ; // query the Component Manager to find a scripting component with a particular
- ; // capability, or determine if a particular scripting component supports a
- ; // particular capability.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
- ; OSA Component Flags
- (defconstant $kOSASupportsCompiling #X2)
- (defconstant $kOSASupportsGetSource #X4)
- (defconstant $kOSASupportsAECoercion #X8)
- (defconstant $kOSASupportsAESending #X10)
- (defconstant $kOSASupportsRecording #X20)
- (defconstant $kOSASupportsConvenience #X40)
- (defconstant $kOSASupportsDialects #X80)
- (defconstant $kOSASupportsEventHandling #X100)
-
- ; Component Selectors
- ; Basic Scripting:
- (defconstant $kOSASelectLoad #X1)
- (defconstant $kOSASelectStore #X2)
- (defconstant $kOSASelectExecute #X3)
- (defconstant $kOSASelectDisplay #X4)
- (defconstant $kOSASelectScriptError #X5)
- (defconstant $kOSASelectDispose #X6)
- (defconstant $kOSASelectSetScriptInfo #X7)
- (defconstant $kOSASelectGetScriptInfo #X8)
- (defconstant $kOSASelectSetActiveProc #X9)
- (defconstant $kOSASelectGetActiveProc #XA)
- ; Compiling:
- (defconstant $kOSASelectScriptingComponentName #X102)
- (defconstant $kOSASelectCompile #X103)
- (defconstant $kOSASelectCopyID #X104)
- ; GetSource:
- (defconstant $kOSASelectGetSource #X201)
- ; AECoercion:
- (defconstant $kOSASelectCoerceFromDesc #X301)
- (defconstant $kOSASelectCoerceToDesc #X302)
- ; AESending:
- (defconstant $kOSASelectSetSendProc #X401)
- (defconstant $kOSASelectGetSendProc #X402)
- (defconstant $kOSASelectSetCreateProc #X403)
- (defconstant $kOSASelectGetCreateProc #X404)
- (defconstant $kOSASelectSetDefaultTarget #X405)
- ; Recording:
- (defconstant $kOSASelectStartRecording #X501)
- (defconstant $kOSASelectStopRecording #X502)
- ; Convenience:
- (defconstant $kOSASelectLoadExecute #X601)
- (defconstant $kOSASelectCompileExecute #X602)
- (defconstant $kOSASelectDoScript #X603)
- ; Dialects:
- (defconstant $kOSASelectSetCurrentDialect #X701)
- (defconstant $kOSASelectGetCurrentDialect #X702)
- (defconstant $kOSASelectAvailableDialects #X703)
- (defconstant $kOSASelectGetDialectInfo #X704)
- (defconstant $kOSASelectAvailableDialectCodeList #X705)
- ; Event Handling:
- (defconstant $kOSASelectSetResumeDispatchProc #X801)
- (defconstant $kOSASelectGetResumeDispatchProc #X802)
- (defconstant $kOSASelectExecuteEvent #X803)
- (defconstant $kOSASelectDoEvent #X804)
- (defconstant $kOSASelectMakeContext #X805)
-
- (defconstant $kOSASelectComponentSpecificStart #X1001)
- ; scripting component specific selectors are added beginning with this
- ; value
-
- ; Mode Flags
- (defconstant $kOSAModePreventGetSource #X1)
- (defconstant $kOSAModeNeverInteract #$KAENEVERINTERACT)
- (defconstant $kOSAModeCanInteract #$KAECANINTERACT)
- (defconstant $kOSAModeAlwaysInteract #$KAEALWAYSINTERACT)
- (defconstant $kOSAModeDontReconnect #$KAEDONTRECONNECT)
- (defconstant $kOSAModeCantSwitchLayer #X40)
- (defconstant $kOSAModeDoRecord #X1000)
- (defconstant $kOSAModeCompileIntoContext #X2)
- (defconstant $kOSAModeAugmentContext #X4)
- (defconstant $kOSAModeDisplayForHumans #X8)
- (defconstant $kOSAModeDontStoreParent #X4000)
-
- ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OSA Basic Scripting Interface
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // Scripting components must at least support the Basic Scripting interface.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
- ; Loading and Storing Scripts
-
-
- (deftrap _osaload ((scriptingcomponent (:pointer :componentinstancerecord)) (scriptdata :aedesc) (modeflags :signed-long) (resultingscriptid (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent scriptdata modeflags resultingscriptid ((+ (ash 12 16) 1) :signed-longint)))
-
-
- (deftrap _osastore ((scriptingcomponent (:pointer :componentinstancerecord)) (scriptid :signed-long) (desiredtype :ostype) (modeflags :signed-long) (resultingscriptdata (:pointer :aedesc)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent scriptid desiredtype modeflags resultingscriptdata ((+ (ash 16 16) 2) :signed-longint)))
-
- ; Executing Scripts
-
-
- (deftrap _osaexecute ((scriptingcomponent (:pointer :componentinstancerecord)) (compiledscriptid :signed-long) (contextid :signed-long) (modeflags :signed-long) (resultingscriptvalueid (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent compiledscriptid contextid modeflags resultingscriptvalueid ((+ (ash 16 16) 3) :signed-longint)))
-
- ; Displaying Results
-
-
- (deftrap _osadisplay ((scriptingcomponent (:pointer :componentinstancerecord)) (scriptvalueid :signed-long) (desiredtype :ostype) (modeflags :signed-long) (resultingtext (:pointer :aedesc)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent scriptvalueid desiredtype modeflags resultingtext ((+ (ash 16 16) 4) :signed-longint)))
-
- ; Getting Error Information
-
-
- (deftrap _osascripterror ((scriptingcomponent (:pointer :componentinstancerecord)) (selector :ostype) (desiredtype :ostype) (resultingerrordescription (:pointer :aedesc)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent selector desiredtype resultingerrordescription ((+ (ash 12 16) 5) :signed-longint)))
-
- ; OSAScriptError selectors:
- (defconstant $kOSAErrorNumber #$KEYERRORNUMBER)
- (defconstant $kOSAErrorMessage #$KEYERRORSTRING)
- (defconstant $kOSAErrorBriefMessage :|errb|)
- (defconstant $kOSAErrorApp :|erap|)
- (defconstant $kOSAErrorPartialResult :|ptlr|)
- (defconstant $kOSAErrorOffendingObject :|erob|)
- (defconstant $kOSAErrorExpectedType :|errt|)
- (defconstant $kOSAErrorRange :|erng|)
-
- ; text ranges:
- (defconstant $typeOSAErrorRange :|erng|)
- (defconstant $keyOSASourceStart :|srcs|)
- (defconstant $keyOSASourceEnd :|srce|)
-
- ; Disposing Script IDs
-
-
- (deftrap _osadispose ((scriptingcomponent (:pointer :componentinstancerecord)) (scriptid :signed-long))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent scriptid ((+ (ash 4 16) 6) :signed-longint)))
-
- ; Getting and Setting Script Information
-
-
- (deftrap _osasetscriptinfo ((scriptingcomponent (:pointer :componentinstancerecord)) (scriptid :signed-long) (selector :ostype) (value :signed-long))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent scriptid selector value ((+ (ash 12 16) 7) :signed-longint)))
-
-
- (deftrap _osagetscriptinfo ((scriptingcomponent (:pointer :componentinstancerecord)) (scriptid :signed-long) (selector :ostype) (result (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent scriptid selector result ((+ (ash 12 16) 8) :signed-longint)))
-
- ; selectors
- (defconstant $kOSAScriptIsModified :|modi|)
- (defconstant $kOSAScriptIsTypeCompiledScript :|cscr|)
- (defconstant $kOSAScriptIsTypeScriptValue :|valu|)
- (defconstant $kOSAScriptIsTypeScriptContext :|cntx|)
- (defconstant $kOSAScriptBestType :|best|)
- (defconstant $kOSACanGetSource :|gsrc|)
-
- ; Manipulating the ActiveProc
-
- (def-mactype :OSAACTIVEPROCPTR (find-mactype :POINTER))
-
-
- (deftrap _osasetactiveproc ((scriptingcomponent (:pointer :componentinstancerecord)) (activeproc :pointer) (refcon :signed-long))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent activeproc refcon ((+ (ash 8 16) 9) :signed-longint)))
-
-
- (deftrap _osagetactiveproc ((scriptingcomponent (:pointer :componentinstancerecord)) (activeproc (:pointer :pointer)) (refcon (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent activeproc refcon ((+ (ash 8 16) 10) :signed-longint)))
-
- ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OSA Optional Compiling Interface
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // Scripting components that support the Compiling interface have the
- ; // kOSASupportsCompiling bit set in it's ComponentDescription.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
-
- (deftrap _osascriptingcomponentname ((scriptingcomponent (:pointer :componentinstancerecord)) (resultingscriptingcomponentname (:pointer :aedesc)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent resultingscriptingcomponentname ((+ (ash 4 16) 258) :signed-longint)))
-
-
- (deftrap _osacompile ((scriptingcomponent (:pointer :componentinstancerecord)) (sourcedata :aedesc) (modeflags :signed-long) (previousandresultingscriptid (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent sourcedata modeflags previousandresultingscriptid ((+ (ash 12 16) 259) :signed-longint)))
-
-
- (deftrap _osacopyid ((scriptingcomponent (:pointer :componentinstancerecord)) (fromid :signed-long) (toid (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent fromid toid ((+ (ash 8 16) 260) :signed-longint)))
-
- ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OSA Optional GetSource Interface
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // Scripting components that support the GetSource interface have the
- ; // kOSASupportsGetSource bit set in it's ComponentDescription.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
-
- (deftrap _osagetsource ((scriptingcomponent (:pointer :componentinstancerecord)) (scriptid :signed-long) (desiredtype :ostype) (resultingsourcedata (:pointer :aedesc)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent scriptid desiredtype resultingsourcedata ((+ (ash 12 16) 513) :signed-longint)))
-
- ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OSA Optional AECoercion Interface
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // Scripting components that support the AECoercion interface have the
- ; // kOSASupportsGetSource bit set in it's ComponentDescription.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
-
- (deftrap _osacoercefromdesc ((scriptingcomponent (:pointer :componentinstancerecord)) (scriptdata :aedesc) (modeflags :signed-long) (resultingscriptid (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent scriptdata modeflags resultingscriptid ((+ (ash 12 16) 769) :signed-longint)))
-
-
- (deftrap _osacoercetodesc ((scriptingcomponent (:pointer :componentinstancerecord)) (scriptid :signed-long) (desiredtype :ostype) (modeflags :signed-long) (result (:pointer :aedesc)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent scriptid desiredtype modeflags result ((+ (ash 16 16) 770) :signed-longint)))
-
- ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OSA Optional AESending Interface
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // Scripting components that support the AESending interface have the
- ; // kOSASupportsAESending bit set in it's ComponentDescription.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
- (def-mactype :AESENDPROCPTR (find-mactype :POINTER))
- (def-mactype :AECREATEAPPLEEVENTPROCPTR (find-mactype :POINTER))
-
- ; The first two proc pointers have the following interfaces
- ; taken from AppleEvents.p
- ;
- ; FUNCTION MyAECreateProc(theAEEventClass: AEEventClass;
- ; theAEEventID: AEEventID;
- ; target: AEAddressDesc;
- ; returnID: INTEGER;
- ; transactionID: LONGINT;
- ; VAR result: AppleEvent): OSErr;
- ;
- ; FUNCTION MyAESendProc(theAppleEvent: AppleEvent;
- ; VAR reply: AppleEvent;
- ; sendMode: AESendMode;
- ; sendPriority: AESendPriority;
- ; timeOutInTicks: LONGINT;
- ; idleProc: IdleProcPtr;
- ; filterProc: EventFilterProcPtr): OSErr;
- ;
- ; FUNCTION MyActiveProc(): OSErr;
- ;
- ;
-
-
- (deftrap _osasetsendproc ((scriptingcomponent (:pointer :componentinstancerecord)) (sendproc :pointer) (refcon :signed-long))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent sendproc refcon ((+ (ash 8 16) 1025) :signed-longint)))
-
-
- (deftrap _osagetsendproc ((scriptingcomponent (:pointer :componentinstancerecord)) (sendproc (:pointer :pointer)) (refcon (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent sendproc refcon ((+ (ash 8 16) 1026) :signed-longint)))
-
-
- (deftrap _osasetcreateproc ((scriptingcomponent (:pointer :componentinstancerecord)) (createproc :pointer) (refcon :signed-long))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent createproc refcon ((+ (ash 8 16) 1027) :signed-longint)))
-
-
- (deftrap _osagetcreateproc ((scriptingcomponent (:pointer :componentinstancerecord)) (createproc (:pointer :pointer)) (refcon (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent createproc refcon ((+ (ash 8 16) 1028) :signed-longint)))
-
-
- (deftrap _osasetdefaulttarget ((scriptingcomponent (:pointer :componentinstancerecord)) (target :aedesc))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent target ((+ (ash 4 16) 1029) :signed-longint)))
-
- ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OSA Optional Recording Interface
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // Scripting components that support the Recording interface have the
- ; // kOSASupportsRecording bit set in it's ComponentDescription.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
-
- (deftrap _osastartrecording ((scriptingcomponent (:pointer :componentinstancerecord)) (compiledscripttomodifyid (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent compiledscripttomodifyid ((+ (ash 4 16) 1281) :signed-longint)))
-
-
- (deftrap _osastoprecording ((scriptingcomponent (:pointer :componentinstancerecord)) (compiledscriptid :signed-long))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent compiledscriptid ((+ (ash 4 16) 1282) :signed-longint)))
-
- ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OSA Optional Convenience Interface
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // Scripting components that support the Convenience interface have the
- ; // kOSASupportsConvenience bit set in it's ComponentDescription.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
-
- (deftrap _osaloadexecute ((scriptingcomponent (:pointer :componentinstancerecord)) (scriptdata :aedesc) (contextid :signed-long) (modeflags :signed-long) (resultingscriptvalueid (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent scriptdata contextid modeflags resultingscriptvalueid ((+ (ash 16 16) 1537) :signed-longint)))
-
-
- (deftrap _osacompileexecute ((scriptingcomponent (:pointer :componentinstancerecord)) (sourcedata :aedesc) (contextid :signed-long) (modeflags :signed-long) (resultingscriptvalueid (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent sourcedata contextid modeflags resultingscriptvalueid ((+ (ash 16 16) 1538) :signed-longint)))
-
-
- (deftrap _osadoscript ((scriptingcomponent (:pointer :componentinstancerecord)) (sourcedata :aedesc) (contextid :signed-long) (desiredtype :ostype) (modeflags :signed-long) (resultingtext (:pointer :aedesc)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent sourcedata contextid desiredtype modeflags resultingtext ((+ (ash 20 16) 1539) :signed-longint)))
-
- ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OSA Optional Dialects Interface
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // Scripting components that support the Dialects interface have the
- ; // kOSASupportsDialects bit set in it's ComponentDescription.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
-
- (deftrap _osasetcurrentdialect ((scriptingcomponent (:pointer :componentinstancerecord)) (dialectcode :signed-integer))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent dialectcode ((+ (ash 2 16) 1793) :signed-longint)))
-
-
- (deftrap _osagetcurrentdialect ((scriptingcomponent (:pointer :componentinstancerecord)) (resultingdialectcode (:pointer :signed-integer)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent resultingdialectcode ((+ (ash 4 16) 1794) :signed-longint)))
-
-
- (deftrap _osaavailabledialects ((scriptingcomponent (:pointer :componentinstancerecord)) (resultingdialectinfolist (:pointer :aedesc)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent resultingdialectinfolist ((+ (ash 4 16) 1795) :signed-longint)))
- ; *** This is obsolete.
- ; *** Use OSAAvailableDialectCodeList and OSAGetDialectInfo.
-
-
- (deftrap _osagetdialectinfo ((scriptingcomponent (:pointer :componentinstancerecord)) (dialectcode :signed-integer) (selector :ostype) (resultingdialectinfo (:pointer :aedesc)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent dialectcode selector resultingdialectinfo ((+ (ash 10 16) 1796) :signed-longint)))
-
-
- (deftrap _osaavailabledialectcodelist ((scriptingcomponent (:pointer :componentinstancerecord)) (resultingdialectcodelist :aedesc))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent resultingdialectcodelist ((+ (ash 4 16) 1797) :signed-longint)))
-
- (defconstant $typeOSADialectInfo :|difo|)
- (defconstant $keyOSADialectName :|dnam|)
- (defconstant $keyOSADialectCode :|dcod|)
- (defconstant $keyOSADialectLangCode :|dlcd|)
- (defconstant $keyOSADialectScriptCode :|dscd|)
-
- ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OSA Optional Event Handling Interface
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // Scripting components that support the Event Handling interface have the
- ; // kOSASupportsEventHandling bit set in it's ComponentDescription.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
- (def-mactype :AEHANDLERPROCPTR (find-mactype :POINTER))
-
-
- (deftrap _osasetresumedispatchproc ((scriptingcomponent (:pointer :componentinstancerecord)) (resumedispatchproc :pointer) (refcon :signed-long))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent resumedispatchproc refcon ((+ (ash 8 16) 2049) :signed-longint)))
-
- ; ResumeDispatchProc constants
- (defconstant $kOSAUseStandardDispatch #$KAEUSESTANDARDDISPATCH)
- (defconstant $kOSANoDispatch #$KAENODISPATCH)
- ; OSASetResumeDispatchProc refCon constants
- (defconstant $kOSADontUsePhac #X1)
-
-
- (deftrap _osagetresumedispatchproc ((scriptingcomponent (:pointer :componentinstancerecord)) (resumedispatchproc (:pointer :pointer)) (refcon (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent resumedispatchproc refcon ((+ (ash 8 16) 2050) :signed-longint)))
-
-
- (deftrap _osaexecuteevent ((scriptingcomponent (:pointer :componentinstancerecord)) (theappleevent :aedesc) (contextid :signed-long) (modeflags :signed-long) (resultingscriptvalueid (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent theappleevent contextid modeflags resultingscriptvalueid ((+ (ash 16 16) 2051) :signed-longint)))
-
-
- (deftrap _osadoevent ((scriptingcomponent (:pointer :componentinstancerecord)) (theappleevent :aedesc) (contextid :signed-long) (modeflags :signed-long) (reply (:pointer :aedesc)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent theappleevent contextid modeflags reply ((+ (ash 16 16) 2052) :signed-longint)))
-
-
- (deftrap _osamakecontext ((scriptingcomponent (:pointer :componentinstancerecord)) (contextname :aedesc) (parentcontext :signed-long) (resultingcontextid (:pointer :signed-long)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent contextname parentcontext resultingcontextid ((+ (ash 12 16) 2053) :signed-longint)))
-
- ; $ENDC ; UsingOSA
-
- ; $IFC NOT UsingIncludes
-
- ; $ENDC
-
- (export '($KOSADONTUSEPHAC $KOSANODISPATCH $KOSAUSESTANDARDDISPATCH
- $KEYOSADIALECTSCRIPTCODE $KEYOSADIALECTLANGCODE $KEYOSADIALECTCODE
- $KEYOSADIALECTNAME $TYPEOSADIALECTINFO $KOSACANGETSOURCE
- $KOSASCRIPTBESTTYPE $KOSASCRIPTISTYPESCRIPTCONTEXT
- $KOSASCRIPTISTYPESCRIPTVALUE $KOSASCRIPTISTYPECOMPILEDSCRIPT
- $KOSASCRIPTISMODIFIED $KEYOSASOURCEEND $KEYOSASOURCESTART
- $TYPEOSAERRORRANGE $KOSAERRORRANGE $KOSAERROREXPECTEDTYPE
- $KOSAERROROFFENDINGOBJECT $KOSAERRORPARTIALRESULT $KOSAERRORAPP
- $KOSAERRORBRIEFMESSAGE $KOSAERRORMESSAGE $KOSAERRORNUMBER
- $KOSAMODEDONTSTOREPARENT $KOSAMODEDISPLAYFORHUMANS
- $KOSAMODEAUGMENTCONTEXT $KOSAMODECOMPILEINTOCONTEXT $KOSAMODEDORECORD
- $KOSAMODECANTSWITCHLAYER $KOSAMODEDONTRECONNECT
- $KOSAMODEALWAYSINTERACT $KOSAMODECANINTERACT $KOSAMODENEVERINTERACT
- $KOSAMODEPREVENTGETSOURCE $KOSASELECTCOMPONENTSPECIFICSTART
- $KOSASELECTMAKECONTEXT $KOSASELECTDOEVENT $KOSASELECTEXECUTEEVENT
- $KOSASELECTGETRESUMEDISPATCHPROC $KOSASELECTSETRESUMEDISPATCHPROC
- $KOSASELECTAVAILABLEDIALECTCODELIST $KOSASELECTGETDIALECTINFO
- $KOSASELECTAVAILABLEDIALECTS $KOSASELECTGETCURRENTDIALECT
- $KOSASELECTSETCURRENTDIALECT $KOSASELECTDOSCRIPT
- $KOSASELECTCOMPILEEXECUTE $KOSASELECTLOADEXECUTE
- $KOSASELECTSTOPRECORDING $KOSASELECTSTARTRECORDING
- $KOSASELECTSETDEFAULTTARGET $KOSASELECTGETCREATEPROC
- $KOSASELECTSETCREATEPROC $KOSASELECTGETSENDPROC
- $KOSASELECTSETSENDPROC $KOSASELECTCOERCETODESC
- $KOSASELECTCOERCEFROMDESC $KOSASELECTGETSOURCE $KOSASELECTCOPYID
- $KOSASELECTCOMPILE $KOSASELECTSCRIPTINGCOMPONENTNAME
- $KOSASELECTGETACTIVEPROC $KOSASELECTSETACTIVEPROC
- $KOSASELECTGETSCRIPTINFO $KOSASELECTSETSCRIPTINFO $KOSASELECTDISPOSE
- $KOSASELECTSCRIPTERROR $KOSASELECTDISPLAY $KOSASELECTEXECUTE
- $KOSASELECTSTORE $KOSASELECTLOAD $KOSASUPPORTSEVENTHANDLING
- $KOSASUPPORTSDIALECTS $KOSASUPPORTSCONVENIENCE $KOSASUPPORTSRECORDING
- $KOSASUPPORTSAESENDING $KOSASUPPORTSAECOERCION $KOSASUPPORTSGETSOURCE
- $KOSASUPPORTSCOMPILING $ERROSACONTROLFLOWERROR
- $ERROSAINCONSISTENTDECLARATIONS $ERROSAUNDEFINEDVARIABLE
- $ERROSADUPLICATEHANDLER $ERROSADUPLICATEPROPERTY
- $ERROSADUPLICATEPARAMETER $ERROSAPARAMETERMISMATCH
- $ERROSAMISSINGPARAMETER $ERROSATOKENTOOLONG $ERROSASYNTAXTYPEERROR
- $ERROSASYNTAXERROR $ERROSAILLEGALASSIGN $ERROSAILLEGALRANGE
- $ERROSAILLEGALINDEX $ERROSAILLEGALACCESS $ERROSAUNDEFINEDHANDLER
- $ERROSAMESSAGENOTUNDERSTOOD $ERROSATYPEERROR $ERROSADATABLOCKTOOLARGE
- $ERROSAINTERNALTABLEOVERFLOW $ERROSASTACKOVERFLOW
- $ERROSACORRUPTTERMINOLOGY $ERROSAAPPNOTHIGHLEVELEVENTAWARE
- $ERROSACANTLAUNCH $ERROSANUMERICOVERFLOW $ERROSADIVIDEBYZERO
- $ERROSAGENERALERROR $ERROSACANTASSIGN $ERROSACANTACCESS
- $ERROSACANTCOERCE $ERROSARECORDINGISALREADYON $ERROSACORRUPTDATA
- $ERROSADATAFORMATTOONEW $ERROSADATAFORMATOBSOLETE
- $ERROSANOSUCHDIALECT $ERROSASOURCENOTAVAILABLE $ERROSABADSELECTOR
- $ERROSASCRIPTERROR $ERROSABADSTORAGETYPE $ERROSAINVALIDID
- $ERROSASYSTEMERROR $TYPEOSAGENERICSTORAGE $KOSASCRIPTRESOURCETYPE
- $KOSARECORDEDTEXT $KOSASUITE $KOSAMODENULL $KOSANULLMODE
- $KOSANULLSCRIPT $KOSAFILETYPE $KOSAGENERICSCRIPTINGCOMPONENTSUBTYPE
- $KOSACOMPONENTTYPE))
- (provide-interface 'OSA)